<template>
  <div class="flex justify-center items-center flex-1" @click="handleClick">
    <img class="w-16px h-16px mr-4px" :src="iconPrev[type]" alt="" />
    <span class="text-16px text-white font-medium">{{ text }}</span>
    <img
      class="w-10px h-6px ml-14px"
      src="@/assets/img/ic-triangle-down.png"
      alt=""
    />
  </div>
</template>

<script setup>
import { defineProps, defineEmits } from 'vue'
import locationIcon from '@/assets/img/ic-location@2x.png'
import timeIcon from '@/assets/img/ic-time@2x.png'

const iconPrev = {
  location: locationIcon,
  time: timeIcon
}
// 定义 props
const { text, type } = defineProps({
  text: {
    type: String,
    required: true
  },
  type: {
    type: String,
    default: 'location'
  }
})

// 定义 emit
const emit = defineEmits(['tap'])

// 处理点击事件
const handleClick = () => {
  emit('tap')
}
</script>

<style scoped>
/* 你可以在这里添加一些 scoped 样式 */
</style>
